//
//  LabelClickViewController.m
//  20170207
//
//  Created by xuPeng on 2017/9/7.
//  Copyright © 2017年 一直丶黑曼巴. All rights reserved.
//
#import "Header.h"
#import "LabelClickViewController.h"

@interface LabelClickViewController ()
@property (nonatomic, strong)UILabel *lab;
@end

@implementation LabelClickViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake((PW -100)/2, 100, 100, 40)];
    lab.backgroundColor = [UIColor cyanColor];
    lab.userInteractionEnabled = YES;
    UITapGestureRecognizer *labTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelTouchUpInside:)];
    
    [lab addGestureRecognizer:labTapGestureRecognizer];
    self.lab = lab;
    [self.view addSubview:self.lab];
}

- (void)labelTouchUpInside:(UITapGestureRecognizer *)recognizer{

        self.lab.backgroundColor = [UIColor orangeColor];
    
}


@end
